<template>
    <div class="body" v-if="JSON.stringify(resume_info) != '{}'">
        <div class="personJl">
            <div class="jl_box jl_box1">
                <dl>
                    <dd>
                        <h1>{{ resume_info.fullname }}</h1>
                        <h2>意向职位:{{ resume_info.intention_jobs }}</h2>
                        <h3>
                            {{ resume_info.sex_cn }}|{{
                                resume_info.district_cn
                            }}|{{ resume_info.education_cn }}|{{
                                resume_info.experience_cn
                            }}
                        </h3>
                    </dd>
                    <dt>
                        <h4><img :src="resume_info.photosrc" alt="" /></h4>
                        <h5>
                            <span v-html="resume_info.refreshtime_cn"></span
                            ><span>来过</span>
                        </h5>
                    </dt>
                </dl>
            </div>

            <div class="jl_box jl_box2">
                <div class="jl_title">
                    <span>求职意向</span>
                    <i>{{ resume_info.wage_cn }}</i>
                </div>
                <ul>
                    <li>工作性质：{{ resume_info.nature_cn }}</li>
                    <li>期望行业：{{ resume_info.trade_cn }}</li>
                    <li>期望职位：{{ resume_info.intention_jobs }}</li>
                    <li>工作地区：{{ resume_info.major_cn }}</li>
                    <li>求职状态：{{ resume_info.current_cn }}</li>
                </ul>
                <!-- <h5>收藏该人才</h5> -->
            </div>

            <div class="jl_box jl_box3" v-if="resume_info.work_list.length > 0">
                <div class="jl_title">
                    <span>工作经历</span>
                </div>

                <div
                    class="jl_wrap"
                    v-for="(item, index) in resume_info.work_list"
                    :key="index"
                >
                    <dl>
                        <dd>
                            <h1>{{ item.companyname }}</h1>
                            <h1>{{ item.jobs }}</h1>
                        </dd>
                        <dt>
                            {{ item.startyear }}.{{ item.startmonth }}-{{
                                item.endyear
                            }}.{{ item.endmonth }}
                        </dt>
                    </dl>

                    <p>工作内容</p>
                    <p>{{ item.achievements }}</p>
                    <div
                        class="jl_line"
                        v-if="resume_info.work_list.length != index + 1"
                    ></div>
                </div>
            </div>

            <div
                class="jl_box jl_box3"
                v-if="resume_info.project_list.length > 0"
            >
                <div class="jl_title">
                    <span>项目经历</span>
                </div>

                <div
                    class="jl_wrap"
                    v-for="(item, index) in resume_info.project_list"
                    :key="index"
                >
                    <dl>
                        <dd>
                            <h1>{{ item.projectname }}</h1>
                            <h1>{{ item.role }}</h1>
                        </dd>
                        <dt>
                            {{ item.startyear }}.{{ item.startmonth }}-{{
                                item.endyear
                            }}.{{ item.endmonth }}
                        </dt>
                    </dl>

                    <p>工作内容</p>
                    <p>{{ item.description }}</p>
                    <div
                        class="jl_line"
                        v-if="resume_info.project_list.length != index + 1"
                    ></div>
                </div>
            </div>

            <div
                class="jl_box jl_box3"
                v-if="resume_info.training_list.length > 0"
            >
                <div class="jl_title">
                    <span>培训经历</span>
                </div>

                <div
                    class="jl_wrap"
                    v-for="(item, index) in resume_info.training_list"
                    :key="index"
                >
                    <dl>
                        <dd>
                            <h1>{{ item.agency }}</h1>
                            <h1>{{ item.course }}</h1>
                        </dd>
                        <dt>
                            {{ item.startyear }}.{{ item.startmonth }}-{{
                                item.endyear
                            }}.{{ item.endmonth }}
                        </dt>
                    </dl>

                    <p>工作内容</p>
                    <p>{{ item.description }}</p>
                    <div
                        class="jl_line"
                        v-if="resume_info.training_list.length != index + 1"
                    ></div>
                </div>
            </div>

            <div
                class="jl_box jl_box3"
                v-if="resume_info.education_list.length > 0"
            >
                <div class="jl_title">
                    <span>教育经历</span>
                </div>

                <div
                    class="jl_wrap"
                    v-for="(item, index) in resume_info.education_list"
                    :key="index"
                >
                    <dl>
                        <dd>
                            <h1>{{ item.school }}</h1>
                        </dd>
                        <dt>
                            {{ item.startyear }}.{{ item.startmonth }}-{{
                                item.endyear
                            }}.{{ item.endmonth }}
                        </dt>
                    </dl>

                    <p>{{ item.education_cn }}</p>
                    <div
                        class="jl_line"
                        v-if="resume_info.education_list.length != index + 1"
                    ></div>
                </div>
            </div>

            <div
                class="jl_box jl_box3"
                v-if="resume_info.credent_list.length > 0"
            >
                <div class="jl_title">
                    <span>获得证书</span>
                </div>

                <div
                    class="jl_wrap"
                    v-for="(item, index) in resume_info.credent_list"
                    :key="index"
                >
                    <dl>
                        <dd>
                            <h1>{{ item.name }}</h1>
                        </dd>
                        <dt>{{ item.year }}.{{ item.month }}</dt>
                    </dl>

                    <div
                        class="jl_line"
                        v-if="resume_info.credent_list.length != index + 1"
                    ></div>
                </div>
            </div>

            <div
                class="jl_box jl_box3"
                v-if="resume_info.language_list.length > 0"
            >
                <div class="jl_title">
                    <span>语言能力</span>
                </div>

                <div
                    class="jl_wrap"
                    v-for="(item, index) in resume_info.language_list"
                    :key="index"
                >
                    <dl>
                        <dd>
                            <h1>{{ item.language_cn }}</h1>
                        </dd>
                        <dt>熟练程度：{{ item.level_cn }}</dt>
                    </dl>

                    <div
                        class="jl_line"
                        v-if="resume_info.language_list.length != index + 1"
                    ></div>
                </div>
            </div>
            
        </div>

        <div class="jl_btmbox">
            <dl>
                <dd>
                    <img
                        src="../../assets/jobimg/zrc_icon_dianhua.png"
                        alt=""
                    />
                </dd>
                <dt><span @click="download">下载简历</span></dt>
            </dl>
        </div>
        <div class="zhanwei"></div>
    </div>
</template>

<script>
import { axiosGet, axiosPost } from '../../axios';
import { Toast } from 'vant';
export default {
    name: '',
    data() {
        return {
            resume_info: {},
        };
    },
    computed: {},
    mounted() {
        this.getDetail();
    },
    methods: {
        getDetail() {
            axiosGet(
                '/apis/resume/detail',
                {
                    id: this.$route.query.id,
                },
                (res) => {
                    // console.log(res);
                    if (res.status != 1) {
                        return Toast({
                            message: res.msg,
                            duration: 2000,
                        });
                    }
                    this.resume_info = res.data.resume_info;
                }
            );
        },
        // 简历下载
        download() {
            axiosPost(
                '/apis/company/resume_down',
                {
                    rid: this.resume_info.id,
                },
                (res) => {
                    Toast({
                        message: res.msg,
                        duration: 2000,
                    });
                    if (res.status != 1) {
                        return;
                    }
                }
            );
        },
    },
};
</script>

<style lang="less" scope>
.personJl {
    .jl_box {
        width: 15.1467rem;
        min-height: 2.1333rem;
        background: #fff;
        border-radius: 0.4267rem;
        margin: 0.4267rem auto;
        padding: 0.64rem;
    }

    .jl_title {
        font-size: 0.64rem;
        font-weight: 500;
        color: #13151d;
        display: flex;
        justify-content: space-between;
        align-items: center;
        line-height: 0.7rem;

        i {
            font-size: 0.6827rem;
            font-weight: 500;
            color: #ff3b3b;
        }
    }

    .jl_box1 {
        dl {
            display: flex;
            justify-content: flex-start;
            align-items: flex-start;

            dd {
                width: 11.3067rem;

                h1 {
                    font-size: 1.024rem;
                    font-weight: 500;
                    color: #13151d;
                }

                h2 {
                    font-size: 0.5973rem;
                    font-weight: 400;
                    color: #000000;
                    margin: 0.64rem auto 0.3627rem;
                }

                h3 {
                    font-size: 0.512rem;
                    font-weight: 500;
                    color: #888888;
                }
            }

            dt {
                width: 3.1rem;

                h4 {
                    width: 1.9413rem;
                    height: 1.9413rem;
                    margin: 0 auto;
                    border-radius: 50%;
                    overflow: hidden;

                    img {
                        height: 1.9413rem;
                    }
                }

                h5 {
                    margin-top: 0.5547rem;
                    text-align: center;
                    color: #888888;
                    font-size: 0.56rem;
                }
            }
        }
        font-size: 48px;
        font-family: PingFang SC;
        font-weight: 500;
        color: #13151d;
    }

    .jl_box2 {
        position: relative;
        ul {
            margin-top: 0.3rem;
            li {
                font-size: 0.512rem;
                font-weight: 500;
                color: #000;
                line-height: 0.7rem;
                margin-top: 0.3rem;
            }
        }
        h5 {
            height: 0.8533rem;
            border: 0.02rem solid #fe333d;
            border-radius: 0.4267rem;
            font-size: 0.512rem;
            font-weight: 500;
            color: #fe333d;
            position: absolute;
            right: 0.64rem;
            padding: 0 0.32rem;
            line-height: 0.8533rem;
            top: 1.6rem;
        }
    }

    .jl_wrap {
        dl {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-top: 0.2rem;
            dd {
                width: 8.9173rem;

                h1 {
                    overflow: hidden;
                    text-overflow: ellipsis;
                    display: -webkit-box;
                    -webkit-box-orient: vertical;
                    -webkit-line-clamp: 2;
                    font-size: 0.5973rem;
                    font-weight: bold;
                    color: #13151d;
                    line-height: 1.024rem;
                }
            }
            dt {
                font-size: 0.4267rem;
                font-weight: 400;
                color: #888888;
                line-height: 1.024rem;
            }
        }
        p {
            font-size: 0.5547rem;
            font-weight: 400;
            color: #666666;
            line-height: 1.28rem;
        }

        .jl_line {
            width: 13.8667rem;
            height: 0.02rem;
            background: #d2d3d5;
            margin: 0.3rem 0 0.35rem;
        }
    }
}

.jl_btmbox {
    overflow: hidden;
    // background: #fff;
    position: fixed;
    z-index: 1000;
    left: 0;
    height: 3.1333rem;
    width: 100%;
    bottom: 0;

    dl {
        height: 2.1333rem;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0.5rem;

        dd {
            width: 2.1333rem;
            height: 2.1333rem;
            background: #fff1f1;
            border: 0.02rem solid #fe333d;
            border-radius: 50%;

            display: flex;
            justify-content: center;
            align-items: center;

            img {
                width: 0.9813rem;
            }
        }

        dt {
            width: 10.24rem;
            height: 2.1333rem;
            background: #fe333d;
            border-radius: 1.0667rem;
            display: flex;
            justify-content: center;
            align-items: center;
            margin-left: 0.64rem;

            span {
                font-size: 0.7253rem;
                font-weight: 400;
                color: #ffffff;
            }
        }
    }
}
</style>
